﻿
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/taglib.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>   
    <title>DataConverge</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">  
    <link rel="stylesheet" type="text/css" href="css/style.css">
    <link type="text/css" rel="stylesheet" href="css/xtree.css">
	<script src="js/xtreeForSearch.js"></script> 
	<script type="text/javascript">		
		function getFrameValues(){		
			var parentNode=document.getElementById("tagIdPlace");
			var docu=document.frames("tagTreeFrame").document;
			var tagId;
			var input;
			var checked=0;
			for(i=0;i<docu.all.tags.length;i++){
					tagId=docu.all.tags[i].value;
					//alert(tagId);
					input=document.createElement("input");
					input.type="checkbox";
					input.name="tags";
					input.value=tagId;
					parentNode.appendChild(input);
					
					if(docu.all.tags[i].checked==true){
						parentNode.lastChild.checked=true;
						checked=checked+1;
					}					
			}
//			if(checked==0 && document.form0.subjectName.value=="" 
//				&& document.form0.orgId.value=="" && document.form0.chargeman.value==""
//				&& document.form0.state.value=="" && document.form0.belongYear.value==""){
//				alert("请输入至少一个查询条件");
//				return false;				
//			}
			var exp = new RegExp("^[0-9]{4}$");
			if(document.form0.belongYear.value!="" && !exp.test(document.form0.belongYear.value)){
					alert("年份格式不对！");
					return false;
			}
			return true;
		}
	</script>  
  </head>
  
<body>
<%@ include file="/WEB-INF/jsp/subject/menu.jsp"%>
<form name="form0" action="subjectSearch.htm" onsubmit="return getFrameValues();" method="post">
<table width="100%" height="75%" align="center" border="1">
<tr>
<td width="30%" height="100%">
<iframe width="260" height="100%" name="tagTreeFrame" frameborder="0" src="tagTree.htm?oper=search">
</iframe>
</td>

<td width="70%">
<table width="100%" border="1">
  <tr style="display:none;">
  	<td id="tagIdPlace" colspan="2"></td>
  </tr>
  <tr>
    <td>课题名称</td>
    <td><input type="text" name="subjectName"></td>
  </tr>
  <!-- <tr>
  	<td>单位</td>
  	<td><input type="text" name="orgName" size="30"><input type="button" value="模糊查找" onclick=""></td>
  </tr>-->
  <tr>
    <td>可选单位</td>
    <td><select name="orgId">
    		<option value=""></option>
      		<c:forEach items="${orgs}" var="org" varStatus="loopStep">
    		  <option value="${org.id}">
    		    <c:out value="${org.name}"/>
    		  </option>
    		</c:forEach>
    	</select>
    </td>
  </tr>
   <tr>
    <td>单位角色</td>
    <td><select name="orgRole">
    		<option value=""></option>
   			<option value="牵头单位">牵头单位</option>
   			<option value="合作单位">合作单位</option>
    	</select>
    </td>
  </tr>
  <tr>
    <td>课题负责人</td>
    <td><input type="text" name="chargeman"></td>
  </tr>
  <tr>
    <td>课题状态</td>
    <td><select name="state">
			<option value=""></option>
			<option value="0">申报中</option>
			<option value="5">未中标</option>
			<option value="1">中标</option>
			<option value="2">在研</option>
			<option value="3">申请结题</option>
			<option value="4">已结题</option>		
			<option value="6">推荐中标</option>		
		</select>
   </td>
  </tr>
  <tr>
  	<td>所属年份</td>
  	<TD><input type="text" name="belongYear"/>(形如：2007)</TD>
  </tr>
</table>
</td>
</tr>
</table>
<br>
<div align="center"><input type="submit" value="查询"></div>
</form>
  </body>
</html>
